#ifndef RULESNIPPETSSQLTABLEMODEL_H
#define RULESNIPPETSSQLTABLEMODEL_H

#include <QSqlTableModel>
#include <QSqlRecord>
#include <QVariant>


/**
 \file rulesnippetssqltablemodel.h

 \class RuleSnippetsSqlTableModel

 \brief Subclass of QSqlTableModel tweaked for Rulesnippets


*/
class RuleSnippetsSqlTableModel : public QSqlTableModel
{
    Q_OBJECT
public:
    explicit RuleSnippetsSqlTableModel(QObject *parent = 0);

    /**
    \brief Constructor that allows model to be set up as readonly
      **************/
    explicit RuleSnippetsSqlTableModel(bool readOnly, QObject *parent = 0);

    /**
    \brief updates rulesnippet row

    \param row - row number (primary key of table)
    \param values - row data

    \return true if successful else false
      ************************/
    virtual bool updateRowInTable(int row, const QSqlRecord &values);

    bool readOnly;

signals:

public slots:

    /**
    \brief redundant debug code - does nothing except issue a qDebug message
      ******************/
    virtual void dropChanges();

    virtual void connectNameUpperCaseSlot();

    virtual void setNameUpperCase(QSqlRecord &record);
    virtual void setNameUpperCaseUpdate(int row, QSqlRecord &record);

protected:





};

#endif // RULESNIPPETSSQLTABLEMODEL_H
